#import "ChatBaseEventListener.h"

@implementation ChatBaseEventListener

- (id) initWithEmitter:(RCTEventEmitter *)emitter{
  if ((self = [super init])) {
    _emitter = emitter;
  }
  return self;
}

- (void) onLoginResponse:(int)code{
  [_emitter sendEventWithName: @"onLoginResponse" 
                         body: @{ @"code": [NSNumber numberWithInt: code] }
  ];
}

- (void) onLinkClose:(int)code{
  [_emitter sendEventWithName: @"onLinkClose" 
                         body: @{ @"code": [NSNumber numberWithInt: code] }
  ];
}

- (void) onKickout:(PKickoutInfo *)kickoutInfo{
  [_emitter sendEventWithName: @"onKickOut" 
                         body: @{ 
                           @"code": [NSNumber numberWithInt: kickoutInfo.code], 
                         }
  ];
}

@end
